package org.example.bean;

import java.math.BigDecimal;

/**
 * 对应数据库表结构的实体类，存储某一年电影的评分统计信息，包括平均评分、最高分、最低分
 */
public class MovieReleaseAvg {
    // 上映年份，对应数据库表的 release_year 字段，类型为 int（在 Java 中可直接用 int 接收 year 类型数据）
    private int releaseYear;
    // 当年电影平均评分，对应数据库表的 avg_score 字段，使用 BigDecimal 保证小数精度
    private BigDecimal avgScore;
    // 当年电影最高分，对应数据库表的 highest_score 字段，使用 BigDecimal 保证小数精度
    private BigDecimal highestScore;
    // 当年电影最低分，对应数据库表的 lowest_score 字段，使用 BigDecimal 保证小数精度
    private BigDecimal lowestScore;

    public MovieReleaseAvg() {
    }

    public MovieReleaseAvg(int releaseYear, BigDecimal avgScore, BigDecimal highestScore, BigDecimal lowestScore) {
        this.releaseYear = releaseYear;
        this.avgScore = avgScore;
        this.highestScore = highestScore;
        this.lowestScore = lowestScore;
    }

    // Getter和Setter方法
    public int getReleaseYear() {
        return releaseYear;
    }

    public void setReleaseYear(int releaseYear) {
        this.releaseYear = releaseYear;
    }

    public BigDecimal getAvgScore() {
        return avgScore;
    }

    public void setAvgScore(BigDecimal avgScore) {
        this.avgScore = avgScore;
    }

    public BigDecimal getHighestScore() {
        return highestScore;
    }

    public void setHighestScore(BigDecimal highestScore) {
        this.highestScore = highestScore;
    }

    public BigDecimal getLowestScore() {
        return lowestScore;
    }

    public void setLowestScore(BigDecimal lowestScore) {
        this.lowestScore = lowestScore;
    }

    @Override
    public String toString() {
        return "MovieReleaseAvg{" +
                "releaseYear=" + releaseYear +
                ", avgScore=" + avgScore +
                ", highestScore=" + highestScore +
                ", lowestScore=" + lowestScore +
                '}';
    }
}